package com.luo.chengrui.module.sa.dal.mysql.auth;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import com.luo.chengrui.module.sa.dal.dataobject.auth.AuthorizeExcludeDO;
import org.apache.ibatis.annotations.Mapper;
import com.luo.chengrui.module.sa.controller.admin.auth.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 被排除的角色  Mapper
 *
 * @author 诚睿
 */
@Mapper
public interface AuthorizeExcludeMapper extends BaseMapperX<AuthorizeExcludeDO> {

    default PageResult<AuthorizeExcludeDO> selectPage(AuthorizeExcludePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AuthorizeExcludeDO>()
                .eqIfPresent(AuthorizeExcludeDO::getOrgFullId, reqVO.getOrgFullId())
                .eqIfPresent(AuthorizeExcludeDO::getRoleId, reqVO.getRoleId())
                .eqIfPresent(AuthorizeExcludeDO::getVersion, reqVO.getVersion())
                .orderByDesc(AuthorizeExcludeDO::getId));
    }

    default List<AuthorizeExcludeDO> selectList(AuthorizeExcludeExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<AuthorizeExcludeDO>()
                .eqIfPresent(AuthorizeExcludeDO::getOrgFullId, reqVO.getOrgFullId())
                .eqIfPresent(AuthorizeExcludeDO::getRoleId, reqVO.getRoleId())
                .eqIfPresent(AuthorizeExcludeDO::getVersion, reqVO.getVersion())
                .orderByDesc(AuthorizeExcludeDO::getId));
    }

    int deleteByEntity(@Param("params") AuthorizeExcludeDO authorizeExclude);
}
